<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="./lib/vue-2.5.9.js"></script>

  <style>
    .v-enter,
    .v-leave-to {
      opacity: 0;
      transform: translateX(100px);
    }

    .v-enter-active,
    .v-leave-active {
      transition: all 0.4s ease;
    }


    .fade-enter,
    .fade-leave-to {
      opacity: 0;
      transform: translateY(100px);
    }

    .fade-enter-active,
    .fade-leave-active {
      transition: all 1s ease;
    }
  </style>
</head>

<body>
  <div id="app">
    <input type="button" value="Toggle" @click="flag=!flag">
    <transition>
      <h3 v-show="flag">111111111</h3>
    </transition>

    <hr>

    <input type="button" value="Toggle2" @click="flag2=!flag2">
    <transition name="fade">
      <h3 v-show="flag2">22222222</h3>
    </transition>
  </div>

  <script>
    // 创建 Vue 实例，得到 ViewModel
    var vm = new Vue({
      el: '#app',
      data: {
        flag: false,
        flag2: false
      },
      methods: {}
    });
  </script>
</body>

</html>